import type { HomeTopBarItem, RecentlyViewItem } from "@/types/home"
import { defineStore } from "pinia"
import { ref } from "vue"

export const useHomeStore = defineStore("home", () => {
    const topBarState = ref<HomeTopBarItem[]>([
        {
            title: "体验课程",
            icon: "photo-o",
        },
        {
            title: "购买课程",
            icon: "coupon-o",
        },
        {
            title: "附近教学",
            icon: "hotel-o",
        },
        {
            title: "交通",
            icon: "logistics",
        },
        {
            title: "相关",
            icon: "guide-o",
        },
    ])

    const navBarState = ref<HomeTopBarItem[]>([
        {
            title: "试看课程",
            icon: "eye-o",
        },
        {
            title: "目的地",
            icon: "location-o",
        },
        {
            title: "我的",
            icon: "manager-o",
        },
        {
            title: "喜欢",
            icon: "like-o",
        },
        {
            title: "更多",
            icon: "more-o",
        },
    ])

    const recentlyViewedState = ref<RecentlyViewItem[]>([
        {
            title: "北京海淀 & 硕士研究生考试直通票",
            cover: "https://ts1.cn.mm.bing.net/th/id/R-C.ef2593524895a09b6c4f0e782bb1b757?rik=lU33LXhZeEYBpA&riu=http%3a%2f%2fexueshi-new-oss.oss-cn-hangzhou.aliyuncs.com%2fproductLogo%2f2020-9-27-1601201398020.jpg&ehk=Idn8Y7YvUtlP74KoDCkijsV3MoZ1uKvCKntA71%2bHfQY%3d&risl=&pid=ImgRaw&r=0",
            price: 173,
        },
        {
            title: "上海徐汇 & 游戏电商主播课",
            cover: "https://tse4-mm.cn.bing.net/th?id=OIF-C.0XbwJyHlxag%2fqwb01IzPZw&rs=1&pid=ImgDetMain",
            price: 120,
        },
        {
            title: "广州天河 & 电商小程序设计辅导",
            cover: "https://pic.huke88.com/product-make/cover/2019-08-28/78A9E64F-4D60-41A5-CD8D-853686964D21.jpg!/fwfh/1840x1124/quality/80/unsharp/true/format/jpg",
            price: 150,
        },
        {
            title: "深圳南山 & 前处理与网格划分",
            cover: "https://public.fangzhenxiu.com/course/2023-4/168181603170320230417221325.png?imageView2/2/h/288",
            price: 100,
        },
        {
            title: "成都武侯 & 动画设计实战班",
            cover: "https://image.gogoup.com/course/20230718/1689662635990.jpg?x-oss-process=image/format,webp",
            price: 130,
        },
        {
            title: "杭州西湖 & 游戏电商主播课",
            cover: "https://tse4-mm.cn.bing.net/th?id=OIF-C.0XbwJyHlxag%2fqwb01IzPZw&rs=1&pid=ImgDetMain",
            price: 90,
        }

    ])

    return {
        topBarState,
        navBarState,
        recentlyViewedState,
    }
})
